home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
pascal
/
zindent7.zip
/
ZINUTL.INC
< prev
next >
Wrap
Text File
|
1987-03-30
|
7KB
|
236 lines
(***********************************************************)
(* Include File *)
(* System Utility, v. 0600am, fri, 27.Mar.87, Glen Ellis *)
(***********************************************************)
(* procedure ****************************************************)
procedure pALARM;
var x : integer;
begin
for x := 1 to 3
do write(chr(7));
end;
(*==============================================================*)
(* System Variable Handling Procedures *)
(* Procedure ******************************************************)
(* System Var Initialize, v. 0500am, sat, 06.Sep.86, Glen Ellis *)
procedure pSysInitz; (* uses globals *)
begin (* proc *)
SysCmdLine := false;
SysCmdFile := false;
SysCmdUser := false;
SysInFilename := ' ';
SysInSource[1] := ' ';
SysEnableBegin := false;
SysLineCnt := false;
SysIndentNum := 0;
SysIndentPos := 0;
SysLenMax := 0;
SysComment := true;
SysLineCnt := false;
SysVertiate := false;
SysInSourceCnt := 0;
SysInSourceMax := 0;
end; (* proc *)
(* procedure ******************************************************)
(* SysLvlInit, v. 1244pm, sun, 31.Aug.86, Glen Ellis *)
procedure pSysLvlInit;
begin (* P *)
(* required for KEYWORD.INC *)
(* fresh for each file being parsed *)
(* not all used in any one application *)
(* rename these if need be, assign in SYSTEM.VAR *)
(* long memvar names used for programming readability *)
(* short memvar names used for passing parms to procedures *)
SysEnableBegin := false; (* flag for first 'begin' *)
SEB := false;
SysLevelIf := 0;
SLI := 0;
SysLevelCase := 0;
SLC := 0;
SysLevelWhile := 0;
SLW := 0;
SysLevelBegin := 0;
SLB := 0;
SysLevelRepeat := 0;
SLR := 0;
end; (* P *)
(* procedure ******************************************************)
(* Sys Var Short Update, v. 0600am, wed, 17.Sep.86, Glen Ellis *)
procedure pSysVarShortUpdt;
begin (* P *)
(* update short named level from long named level vars *)
(* required for KEYWORD.INC *)
(* fresh for each file being parsed *)
(* not all used in any one application *)
(* rename these if need be, assign in SYSTEM.VAR *)
SOLL := SysOutLine;
SIP := SysIndentPos;
SIN := SysIndentNum;
SLM := SysLenMax;
SMW := SysMarkWrite;
SEB := SysEnableBegin;
SLI := SysLevelIF;
SLC := SysLevelCASE;
SLW := SysLevelWHILE;
SLB := SysLevelBEGIN;
SLR := SysLevelREPEAT;
end; (*proc*)
(* procedure ******************************************************)
(* Sys Var Long UPDate, v. 0600am, wed, 17.Sep.86, Glen Ellis *)
procedure pSysVarLongUpdt;
begin (*proc*)
(* Downdate short named level into long named level vars *)
(* required for KEYWORD.INC *)
(* fresh for each file being parsed *)
(* not all used in any one application *)
(* rename these if need be, assign in SYSTEM.VAR *)
SysOutLine := SOLL;
SysIndentPos := SIP;
SysIndentNum := SIN;
SysLenMax := SLM;
SysMarkWrite := SMW;
SysEnableBegin := SEB;
SysLevelIF := SLI;
SysLevelCASE := SLC;
SysLevelWHILE := SLW;
SysLevelBEGIN := SLB;
SysLevelREPEAT := SLR;
end; (*proc*)
(* procedure ****************************************************)
(* Say System Variables, v. 0900am, sat, 20.Sep.86, Glen Ellis *)
procedure pSaySysVar;
var
line : Thestr;
cmdline, cmdfile, cmduser : string7 ;
comment, linecnt, vertiate : string7;
indentnum, indentpos, lenmax, insourcecnt, insourcemax : string7;
begin (* P *)
(* BIG display prior to CORE *)
(* pause for preceding display of filename list *)
pDelay4;
(* operating parameters *)
FOR x := 1 to 23
do writeln; (* Apple/CPM clear screen *)
begin (* say sys var *)
line := 'A: SysUtl.inc, pSaySysVar : OPERATING variables';
pSayLnCJ(line,80);
line := 'Parameter Source Control variables';
pSayLnCJ(line,80);
IF SysCmdLine then cmdline:='true' else cmdline:= 'false';
IF SysCmdFile then cmdfile:='true' else cmdfile:= 'false';
IF SysCmdUser then cmduser:='true' else cmduser:= 'false';
line := 'L='+cmdline+' : F='+cmdfile+' : U='+cmduser ;
pSayLnCJ(line,80);
line := 'SysInFileName = ' + SysInFileName;
pSayLnCJ(line,80);
IF SysComment then comment :='true' else comment := 'false';
IF SysLineCnt then linecnt :='true' else linecnt := 'false';
IF SysVertiate then vertiate :='true' else vertiate := 'false';
writeln;
line := 'SysComment = ' + comment;
pSayLnCJ(line,80);
line := 'SysLineCNT = ' + linecnt;
pSayLnCJ(line,80);
line := 'SysVertiate = ' + vertiate;
pSayLnCJ(line,80);
str(SysIndentNum,indentnum);
str(SysIndentPos,indentpos);
str(SysLenMax ,lenmax );
line :=
'SysIndentNUM = ' + indentnum +
' : SysIndentPOS = ' + indentpos +
' : SysLineMAX = ' + lenmax;
pSayLnCJ(line,80);
str(SysInSourceCnt,insourcecnt);
str(SysInSourceMax,insourcemax);
line :=
'SysInSourceCNT = ' + insourcecnt +
' : SysInsourceMAX = ' + insourcemax;
pSayLnCJ(line,80);
line := 'SysPgmMod = ' + SysPgmMod;
pSayLnCJ(line,80);
line := '<CR> continue, <ESC> halt';
pSayLnCJ(line,80);
pReadCR;
(* wait for programmer; takes time to read this display *)
end; (* say sys var *)
end; (*proc*)
(* procedure ***********************************************)
(* System Filenames, v. 0719am, sun, 31.Aug.86, Glen Ellis *)
procedure pSaySysFiles;
begin(* P *)
writeln;
writeln('SysPgmMod = ',SysPgmMod);
writeln(' file.BAK = ',SysFile0);
writeln('SysInFilename = ',SysFile1);
writeln(' file.$$$ = ',SysFile2);
writeln;
end; (* P *)
(* procedure ***************************************************)
(* SYStem LeVeL Write , v. 0734am, sun, 31.Aug.86, Glen Ellis *)
procedure pSysLvlWrite;
begin (* P *)
(* uses system vars *)
pSysVarShortUpdt;
IF SysComment then
begin
(**)
(* Displays Count of Keyword Actions : (shift right - shift left ) *)
(* very useful for debugging *)
(* has been usefully attached to end of output files. *)
(**)
(* dBASE has three distinct forms *)
IF SysPgmMod = 'DB' then
writeln(SysOutFile,SPMSL,':I:',SLI,' :C:',SLC,' :W:',SLW,SPMSR);
(**)
(* Pascal can be simplified to one form *)
IF SysPgmMod = 'TP' then
writeln(SysOutFile,SPMSL,':B:',SLB,SPMSR);
(**)
end;
end; (*proc*)
(***********************************************************************)
(*<<<>>>*)